<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>JavaScript 数组方法 </title>
</head>
<body>
<h2>Popping </h2>
<p>pop() 方法从数组中删除最后一个元素：</p>

<p id="demo1"></p>
<p id="demo2"></p>

<script>
  var fruits=["Banana","Apple","Mango"];
  document.getElementById("demo1").innerHTML=fruits;
  fruits.pop();
  document.getElementById("demo2").innerHTML=fruits;
</script>
</body>
</html>


<!--
运行结果：
Banana,Apple,Mango

Banana,Apple


document.getElementById("demo2").innerHTML = fruits.pop();
结果：Mango  返回值是已删除的项目
-->